package com.example.vehicleservice.mapper1;

import com.example.vehicleservice.bean.*;
import com.example.vehicleservice.bean1.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface NewCarMapper {

    // TODO: 2025/6/6  行程分析
    @Select("select Vin,distance,duration,vgSpeed,maxSpeed,speeding from new_car.dws_itineraryanalysis")
    List<TripMetrics> getTripMetrics();

    // TODO: 2025/6/6 异常监控与告警
    @Select("select vin,alarm_type from new_car.dws_Abonrmal")
    List<Abonrmal> getAbonrmaly();

    // TODO: 2025/6/6  实时在线统计车辆数
    @Select("select name,countCar from new_car.dws_onlineVehicles")
    List<OnlineCountResult> getOnlineCountResult();

    // TODO: 2025/6/6  电池的平均健康度
    @Select("select name,avgcell from new_car.dws_avgBatteryLevel")
    List<AvgBatteryLevelResult> getAvgBatteryLevelResult();

    // TODO: 2025/6/6 热力分布图
    @Select("select name,countCar from new_car.dws_heatmapStream")
    List<HeatmapDataResult> getHeatmapDataResult();

    // TODO: 2025/6/6 实时监控车辆
    @Select("select vin,\n" +
            "speed,\n" +
            "mileage,\n" +
            "batteryLevel,\n" +
            "batteryTemp,\n" +
            "chargingStatus,\n" +
            "energyConsumption from new_car.dws_vehiclemonitorin")
    List<VehicleData> getVehicleData();
}
